<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.5.1.js"></script>
    <script>
        //发送异步请求
        function f(){
            var x;
            //核心对象
            if(window.XMLHttpRequest)
                x=new XMLHttpRequest()
            else x=new ActiveXObject("Micsoft.XMLHTTP")
            //发送请求
            /*
             */
            x.open("get","helloServlet?name=wang",true)
            x.send()
        }
    </script>
    <script>
        // json对象格式
        // $.ajax({
        //     url:" ",
        //     type:"post",
        //     data:JSON.stringify({
        //         adminId:adminId,
        //         password:password}),
        //     contentType: "application/json;charset=UTF-8",
        //     dataType:"json",
        //     success:function (data) {
        //
        //     }
        // });
        function ff(){
        console.log("发送请求")
        $.ajax({
            url:"http://114.55.253.244:8001/data/getDataOfPie",
            type:"post",
            data: null,
            dataType:"json",
            success: function(data){
                console.log(data);
            },
            error:function (res){
                console.log(res)
            }
        });
        // 标准参数模式 “username=chen&nickname=alien”
        $.ajax({
            url:"http://114.55.253.244:8001/data/getDataByDate",
            type:"post",
            data:{
                "begin":"2020-12-01",
                "end":"2020-12-05"
            },
            dataType:"json",
            success: function(data){
                console.log(data);
            } ,error:function (res){
                console.log(res)
            }
        });}
    </script>

</head>
<body>
<input type="button" value="ajax请求" onclick="ff()">
<input>
<a>学号分别是:2021****48 2021****66</a><br>
<h3></h3>>
<img src="https://tse1-mm.cn.bing.net/th/id/OIP.GHZQPEmVGRTDasaumregFAHaEo?w=306&h=191&c=7&o=5&dpr=1.5&pid=1.7"/>
</body>
</html>